package io.wdb.wxapp.model;

import java.io.Serializable;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;

import io.swagger.annotations.ApiModelProperty;

import io.wdb.modules.activity.wxapp.entity.HdShareRecordEntity;


/**
 * 分享记录
 * 
 * @author wdb
 * @email xulin@wdb007.com
 * @date 2018-01-22 15:22:58
 */
public class HdShareRecordModel implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@ApiModelProperty(value = "", required = true)
	private String id;
	@ApiModelProperty(value = "分享标题", required = true)
	private String title;
	@ApiModelProperty(value = "分享路径", required = true)
	private String path;
	@ApiModelProperty(value = "分享群/人id", required = true)
	private String wxGroupId;
	@ApiModelProperty(value = "分享时间", required = true)
	private Date shareTime;
	@ApiModelProperty(value = "", required = true)
	private String userId;
	@ApiModelProperty(value = "", required = true)
	private String activityId;

	/**
	 * 设置：
	 */
	public void setId(String id) {
		this.id = id;
	}
	/**
	 * 获取：
	 */
	public String getId() {
		return id;
	}
	/**
	 * 设置：分享标题
	 */
	public void setTitle(String title) {
		this.title = title;
	}
	/**
	 * 获取：分享标题
	 */
	public String getTitle() {
		return title;
	}
	/**
	 * 设置：分享路径
	 */
	public void setPath(String path) {
		this.path = path;
	}
	/**
	 * 获取：分享路径
	 */
	public String getPath() {
		return path;
	}
	/**
	 * 设置：分享群/人id
	 */
	public void setWxGroupId(String wxGroupId) {
		this.wxGroupId = wxGroupId;
	}
	/**
	 * 获取：分享群/人id
	 */
	public String getWxGroupId() {
		return wxGroupId;
	}
	/**
	 * 设置：分享时间
	 */
	public void setShareTime(Date shareTime) {
		this.shareTime = shareTime;
	}
	/**
	 * 获取：分享时间
	 */
	public Date getShareTime() {
		return shareTime;
	}
	/**
	 * 设置：
	 */
	public void setUserId(String userId) {
		this.userId = userId;
	}
	/**
	 * 获取：
	 */
	public String getUserId() {
		return userId;
	}
	/**
	 * 设置：
	 */
	public void setActivityId(String activityId) {
		this.activityId = activityId;
	}
	/**
	 * 获取：
	 */
	public String getActivityId() {
		return activityId;
	}

    public static HdShareRecordModel convert(HdShareRecordEntity entity) {
		if(entity == null) {
			return null;
		}
		HdShareRecordModel model = new HdShareRecordModel();
				model.setId(entity.getId());
				model.setTitle(entity.getTitle());
				model.setPath(entity.getPath());
				model.setWxGroupId(entity.getWxGroupId());
				model.setShareTime(entity.getShareTime());
				model.setUserId(entity.getUserId());
				model.setActivityId(entity.getActivityId());
				
		return model;
	}
	public static List<HdShareRecordModel> convert(List<HdShareRecordEntity> entities){
		if(entities == null || entities.isEmpty()) {
			return null;
		}
		List<HdShareRecordModel> models = new ArrayList<>();
		
		for(HdShareRecordEntity entity:entities) {
			models.add(convert(entity));
		}
		
		return models;
	}
	
	public static HdShareRecordEntity convert(HdShareRecordModel model) {
		if(model == null) {
			return null;
		}
		HdShareRecordEntity entity = new HdShareRecordEntity();
				entity.setId(model.getId());
				entity.setTitle(model.getTitle());
				entity.setPath(model.getPath());
				entity.setWxGroupId(model.getWxGroupId());
				entity.setShareTime(model.getShareTime());
				entity.setUserId(model.getUserId());
				entity.setActivityId(model.getActivityId());
				
		return entity;
	}

}
